package behavioral.mediator;

/**
 * @ClassName: MainTest
 * @Description: 测试类
 * @Author: liu-hao
 * @Date: 2023-04-12 23:55
 * @Version: 1.0
 **/
public class MainTest {
    public static void main(String[] args) {
        // 创建中介
        ConcreteMediator mediator = new ConcreteMediator();

        // 创建两个同事
        ConcreteColleague zhangSan = new ConcreteColleague("张三");
        ConcreteColleague liSi = new ConcreteColleague("李四");

        // 中介关联具体的同事对象
        mediator.register(zhangSan);
        mediator.register(liSi);

        // 发送消息
        zhangSan.send("李四", "你好，我是张三");
    }
}
